#include "datacollectmenu.h"
#include "ui_datacollectmenu.h"

#include <Utils/settingmanager.h>
#include <Utils/settingpro.h>

#include <qmessagebox.h>

DataCollectMenu::DataCollectMenu(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::DataCollectMenu)
{
    ui->setupUi(this);
    // dataCollect_ECG=new DataCollect_ECG();
    // connect(this,SIGNAL(startThread()),dataCollect_ECG,SLOT(startthread()));
    dataCollect_EEG2=new DataCollect_EEG2();
}

DataCollectMenu::~DataCollectMenu()
{
    // delete dataCollect_ECG;
    delete dataCollect_EEG2;
    delete ui;
}

void DataCollectMenu::on_pb_close_clicked()
{
    this->close();
}


void DataCollectMenu::on_pb_ecg_clicked()
{
    SettingManager BindD("bindDevice");
    if(BindD.getValue<QString>("eegMac", "").length()==12)
    {
        emit startThread();
        dataCollect_ECG->show();
    }else{
        QMessageBox::about(this,"温馨提醒","您未绑定心电贴设备，请您先绑定");
    }
}


void DataCollectMenu::on_pb_eeg2_clicked()
{
    SettingManager BindD("bindDevice");
    if(BindD.getValue<QString>("eegMac", "").length()==12)
    {
        dataCollect_EEG2->show();
    }else{
        QMessageBox::about(this,"温馨提醒","您未绑定双通道脑电头带设备，请您先绑定");
    }

}

